package com.tencent.welink.api.video;

import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * desc:获取录像文件
 * Created by junchihe on 2020/6/4.
 */
public class GetVideoStream extends WelinkOpenApi {
    private static final Logger log = LogManager.getLogger(GetVideoStream.class);

    public GetVideoStream() {
        super("/common/video/getVideoStream", true);
    }

    @Override
    public void displayResult(String result) {

    }

    /**
     * [144115194519265640_20170510_122205.mtav]
     s=12:22:05.853
     d=8007
     t=10000000
     p=hdfs://192.168.1.1:8020/bucket/144115194519265640/2017-05-10/144115194519265640_20170510_122205.mtav
     [144115194519265640_20170510_122213.mtav]
     s=12:22:13.862
     d=7999
     t=10000000
     p=hdfs://192.168.1.1:8020/bucket/144115194519265640/2017-05-10/144115194519265640_20170510_122213.mtav
     *
     * 请求参数	参数类型	是否必填	参数说明
     token	String	是	鉴权参数：登录获取的动态密钥
     iotim_ticket	String	是	鉴权参数：登录获取的物联票据
     din	String	是	设备的唯一标识
     id	String	是	录像列表中返回的参数 为上面的p值
     sub_id	String	否	子摄像头id
     * @param args
     */

    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes, true);
        GetVideoStream getVideoStream = new GetVideoStream();
        Map<String, Object> map = getVideoStream.getExtendsPara();

        map.put("din", "200200000000000122");
      //  map.put("month","202006");
        getVideoStream.DoHttp();
        CrontabUtil.shutdown();
    }
}